package com.vslimit.mapper;

import com.vslimit.dto.VoaCatDTO;
import com.vslimit.dto.VoaUrlDTO;
import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * Created by IntelliJ IDEA.
 * User: vslimit
 * Date: 12-4-4
 * Time: 上午12:44
 * To change this template use File | Settings | File Templates.
 */
public class VoaUrlMapper implements RowMapper {
    @Override
    public Object mapRow(ResultSet rs, int rowNum) throws SQLException {
        VoaUrlDTO voaUrlDTO = new VoaUrlDTO();
        voaUrlDTO.setId(rs.getInt("id"));
        voaUrlDTO.setName(rs.getString("name"));
        voaUrlDTO.setCatId(rs.getInt("cat_id"));
        voaUrlDTO.setContent(rs.getString("content"));
        voaUrlDTO.setStatus(rs.getString("status"));
        voaUrlDTO.setLrcPath(rs.getString("lrc_path"));
        voaUrlDTO.setMp3Path(rs.getString("mp3_path"));
        voaUrlDTO.setRecordDate(rs.getTimestamp("record_date"));
        voaUrlDTO.setTranslation(rs.getString("translation"));
        voaUrlDTO.setUrl(rs.getString("url"));
        voaUrlDTO.setYi(rs.getInt("yi"));
        voaUrlDTO.setZi(rs.getInt("zi"));
        return voaUrlDTO;
    }
}
